{include file="public/header"}
  
  <body>
    <div class="x-body">
        <form class="layui-form">
          <div class="layui-form-item">
              <label for="L_email" class="layui-form-label">
                  <span class="x-red">*</span>客户名称
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_email" name="name"
                  autocomplete="off" class="layui-input" value="">
              </div>
              <!-- <div class="layui-form-mid layui-word-aux">
                  <span class="x-red">*</span>将会成为您唯一的登入名
              </div> -->
          </div>
          <div class="layui-form-item">
              <label for="L_username" class="layui-form-label">
                  <span class="x-red">*</span>余额
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_username" name="money"
                  autocomplete="off" class="layui-input" value="">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="L_pass" class="layui-form-label">
                  <span class="x-red">*</span>到期时间
              </label>

              <div class="layui-input-inline">
                  <input type="text" id="L_pass" name="expire_time"
                  autocomplete="off" class="layui-input" value="">

              </div>
          </div>
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
                  <span class="x-red">*</span>每月流量
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_repass" name="flow_caps"
                  autocomplete="off" class="layui-input" value="">
              </div>
              <div class="layui-form-mid layui-word-aux">
                  每月流量上限控制
              </div>
          </div>

          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
                  <span class="x-red">*</span>内存上限
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_repass" name="allspace"
                  autocomplete="off" class="layui-input" value="">
              </div>
              <div class="layui-form-mid layui-word-aux">
                  储存空间上限控制
              </div>
          </div>

          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
                  <span class="x-red">*</span>FTP登录地址
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_repass" name="ftp_login"
                  autocomplete="off" class="layui-input" value="">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
                  <span class="x-red">*</span>FTP账户
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_repass" name="ftp_account"
                  autocomplete="off" class="layui-input" value="">
              </div>
          </div>
          
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
                  <span class="x-red">*</span>FTP密码
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_repass" name="ftp_pw"
                  autocomplete="off" class="layui-input" value="">
              </div>
          </div>

          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
                  <span class="x-red">*</span>数据库登录
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_repass" name="database_login"
                  autocomplete="off" class="layui-input" value="">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
                  <span class="x-red">*</span>数据库账户
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_repass" name="database_account"
                  autocomplete="off" class="layui-input" value="">
              </div>
          </div>
          
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
                  <span class="x-red">*</span>数据库密码
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_repass" name="database_pw"
                  autocomplete="off" class="layui-input" value="">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
                  <span class="x-red">*</span>网站账户
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_repass" name="web_account"
                  autocomplete="off" class="layui-input" value="">
              </div>
          </div>
          
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
                  <span class="x-red">*</span>网站密码
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_repass" name="web_pw"
                  autocomplete="off" class="layui-input" value="">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
              </label>
              <button  class="layui-btn" lay-filter="add" id="memberEdit">
                  增加
              </button>
          </div>
      </form>
    </div>
    {include file="public/base_js"}
    <script>
      layui.use(['form','layer'], function(){
          $ = layui.jquery;
        var form = layui.form
        ,layer = layui.layer;
      
        //自定义验证规则
        /*form.verify({
          nikename: function(value){
            if(value.length < 5){
              return '昵称至少得5个字符啊';
            }
          }
          ,pass: [/(.+){6,12}$/, '密码必须6到12位']
          ,repass: function(value){
              if($('#L_pass').val()!=$('#L_repass').val()){
                  return '两次密码不一致';
              }
          }
        });*/

        //监听提交
        /*form.on('submit(add)', function(data){
          console.log(data);
          //发异步，把数据提交给php
          layer.alert("增加成功", {icon: 6},function () {
              // 获得frame索引
              var index = parent.layer.getFrameIndex(window.name);
              //关闭当前frame
              parent.layer.close(index);
          });
          return false;
        });*/
        
        $('#memberEdit').on('click',function () {
            $.ajax({
                type:'post',
                url: "{:url('member/update')}",
                data: $('.layui-form').serialize(),
                dataType:'json',
                success:function (data) {
                    if (data.status == 1) {
                        layer.msg(data.msg, {'time': 500} ,function(){
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        });
                    } else {
                        layer.msg(JSON.stringify(data.msg));
                    }
                }
            });
            return false;
        });
      });
  </script>
  </body>

</html>